package com.lc202309;

/**
 * Description:
 *
 * @Create 2023/9/26 23:25
 * @Version 1.0
 */
public class Solution2582 {
    public int passThePillow(int n, int time) {
        int tmp = time % (n - 1);
        if (time / (n - 1) % 2 == 0) {
            return tmp + 1;
        }
        return n - tmp;
    }
}
